# Extreme value theorem.
This is a key property of a continuous function on a compact set $K$.
> Extreme value theorem.
> If $f : K \to \mathbf{R}$ is a continuous real-valued function on compact set $K$, then there exists some $a,b \in K$ such that for all $x \in K$, we have $f(a) \le f(x) \le f(b)$.
How should we prove this? First let us assume $K$ is a compact metric space.
In this case we have the characterization:
> Suppose $K$ is a metric space. Then $K$ is compact if and only if $K$ is sequentially compact, that is, every sequence $(a_{n})$ in $K$ has a convergent subsequence $(a_{n(k)})$ that converges in $K$.
So suppose that $f:K\to \mathbf{R}$ does not have a global minimum on $K$. Then there exists a sequence $a_{n}$ in $K$ such that $f(a_{n})$ strictly decreases.
By sequential compactness, there exists a convergent subsequence $a_{n(k)}\to a \in K$. As $f$ is continuous, then we have $f(a_{n(k)}) \to f(a)$, and that this is still a strictly decreasing real sequence.